import {task, progress, group, user, document, pageInfo} from '../fragment'

export const taskGetMyCreates = `query (
  $type: String,
  $params: JSON,
  $currentPage: Int,
  $pageSize: Int
) {
  taskGetMyCreates (
    filter: {
      type: $type,
      params: $params
    },
    currentPage: $currentPage,
    pageSize: $pageSize
  ) {
    page {
      ${pageInfo}
    }
    rows {
      ${task}
      document {
        ${document}
      }
      group {
        ${group}
      }
    }
  }
}`

export const getById = `query ($taskId: ID!) {
  task (id: $taskId) {
    ${task}
    document {
      ${document}
    }
    group {
      ${group}
    }
    creator {
      ${user}
    }
    progresses {
      ${progress}
      user {
        ${user}
      }
    }
  }
}`
